package cn.xiaobai.enums;

/**
 * 防火墙模版
 *
 * @Author yangdaji
 * @Date 2023/2/27 0027
 * @PackageName cn.xiaobai.enums
 * @ClassName FirewalldTemplateEnum
 */
public enum FirewalldTemplateEnum {

    /**
     * Linux 系统防火墙开放指定ip模版
     */
    OP_IP_PORT_LINUX("firewall-cmd --permanent --add-rich-rule=\"rule family=\"ipv4\" source address=\"IP_NAME\" port protocol=\"tcp\" port=\"PORT_NAME\" accept\";", "开放指定ip访问指定端口"),
    // 设置默认协议 : tcp
    OP_IP_PORT_WINDOWS("netsh advfirewall firewall add rule name=firewall-whitelist description=\"防火墙白名单\" dir=in action=allow remoteip=\"IP_NAME\" remoteport=\"PORT_NAME\" protocol=tcp", "开放指定ip访问指定端口");

    private String template;
    private String desc;

    FirewalldTemplateEnum(String template, String desc) {
        this.template = template;
        this.desc = desc;
    }

    public String getTemplate() {
        return template;
    }

    public String getDesc() {
        return desc;
    }
}
